﻿<navigation:Page x:Class="GranitePackageSystem.Views.Request.Licensing" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
           xmlns:layoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
           xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
           d:DesignWidth="800" d:DesignHeight="1024" MaxWidth="1024"
           Title="Licensing Page">
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="10" />
            <RowDefinition Height="333*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="250" />
            <ColumnDefinition Width="550*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.ColumnSpan="2" Margin="10" Name="panelTitle">
            <TextBlock Text="Licensing View" FontSize="18" FontWeight="Bold" HorizontalAlignment="Center" />
        </StackPanel>
        <StackPanel Grid.Row="1" Name="panelLandingNav" Margin="10,10,10,0" Background="#FF484848" Height="Auto" VerticalAlignment="Top" Width="200" HorizontalAlignment="Center">
            <HyperlinkButton x:Name="linkHome" NavigateUri="/Home" TargetName="ContentFrame" Content="Dashboard" Style="{StaticResource LinkStyle}" Background="{x:Null}" AllowDrop="True" HorizontalContentAlignment="Left" Margin="16,0,0,0"/>
            <controlsToolkit:Expander ExpandDirection="Down" Name="expanderRequest" Visibility="Visible" IsExpanded="True">
                <controlsToolkit:Expander.Header>
                    <TextBlock Text="Current Request" FontSize="12" Foreground="White" TextAlignment="Left" Name="expanderHeader" />
                </controlsToolkit:Expander.Header>
                <controlsToolkit:Expander.Content>
                    <StackPanel HorizontalAlignment="Right" Margin="30,0,0,0" Width="AUTO">
                        <HyperlinkButton x:Name="linkTestingDetails" NavigateUri="/Request/TestingDetails" TargetName="ContentFrame" Content="• Testing Environment" Margin="0,0,5,0" Style="{StaticResource LinkStyle}" HorizontalContentAlignment="Left" Visibility="Visible" />
                        <HyperlinkButton x:Name="linkPackageDetails" NavigateUri="/Request/PackageDetails" TargetName="ContentFrame" Content="• Package Details" Margin="0,0,5,0" Style="{StaticResource LinkStyle}" HorizontalContentAlignment="Left" Visibility="Visible" />
                        <HyperlinkButton x:Name="linkLicensingDetails" NavigateUri="/Request/Licensing" TargetName="ContentFrame" Content="• Licensing Details" Margin="0,0,5,0" Style="{StaticResource LinkStyle}" HorizontalContentAlignment="Left" Visibility="Visible" Foreground="#FF42A1F5" />
                        <HyperlinkButton x:Name="linkSummaryDetails" NavigateUri="/Request/RequestSummary" TargetName="ContentFrame" Content="• Request Summary" Margin="0,0,5,0" Style="{StaticResource LinkStyle}" HorizontalContentAlignment="Left" Visibility="Collapsed" />
                    </StackPanel>
                </controlsToolkit:Expander.Content>
            </controlsToolkit:Expander>
        </StackPanel>
        <controlsToolkit:BusyIndicator Name="busyIndicatorMain" Grid.Column="1" Grid.Row="1">
            <StackPanel Name="panelMainContent">
                <Image Name="image" Source="/GranitePackageSystem;component/Assets/Resources/LicensePage.png" />
                <StackPanel Name="panelLicenseEdit" Margin="10" Orientation="Horizontal" HorizontalAlignment="Center" Visibility="Collapsed">
                    <TextBlock Text="Saved Licensing Data" VerticalAlignment="Center" />
                    <Button Name="btnEditLicensingData" Content="Edit License Data" HorizontalAlignment="Right" Margin="10,0,0,0" Click="btnEditLicensingData_Click" />
                </StackPanel>
                <StackPanel Name="panelMainSoftwareOrigin">
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="10">
                        <TextBlock Text="Software Origin:" Width="180" />
                        <Button Name="btnHelpSoftwareOrigin" Content="?" Height="20" Margin="0,0,20,0" />
                        <ComboBox SelectedIndex="0" Name="boxSoftwareOrigin" Width="220" SelectionChanged="boxSoftwareOrigin_SelectionChanged">
                            <ComboBoxItem Content="Not General Mills Developed" />
                            <ComboBoxItem Content="General Mills Developed" />
                        </ComboBox>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="10,0,0,10">
                        <TextBlock Text="Request Origin:" Width="180" />
                        <Button Name="btnHelpRequestOrigin" Content="?" Height="20" Margin="0,0,20,0" />
                        <ComboBox SelectedIndex="0" Name="boxRequestOrigin" Width="220" SelectionChanged="boxRequestOrigin_SelectionChanged">
                            <ComboBoxItem Content="Windows 7 Upgrade Project" />
                            <ComboBoxItem Content="New Software" />
                        </ComboBox>
                    </StackPanel>
                    <StackPanel Name="panelSubSoftwareOrigin">
                        <StackPanel Orientation="Horizontal" Name="panelProcurementMethod" Margin="10,0,0,10">
                            <TextBlock Text="Software Procurement Method" Width="180" VerticalAlignment="Center" />
                            <Button Name="btnHelpSoftwareProcurementMethod" Content="?" Height="20" Margin="0,0,20,0" VerticalAlignment="Center" />
                            <ComboBox Name="boxSoftwareProcurementMethod" SelectedIndex="0" Width="220" SelectionChanged="boxSoftwareProcurementMethod_SelectionChanged">
                                <ComboBoxItem Content="SAP SRM request" />
                                <ComboBoxItem Content="Maximo Request" />
                                <ComboBoxItem Content="Corporate Credit Card" />
                                <ComboBoxItem Content="Personal Credit Card" />
                                <ComboBoxItem Content="IS Sourcing PCard" />
                                <ComboBoxItem Content="No Cost" />
                            </ComboBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Name="panelSoftwareCost" Margin="10,0,0,10">
                            <TextBlock Text="Software Cost" Width="180" VerticalAlignment="Center" />
                            <Button Name="btnHelpSoftwareCost" Content="?" Height="20" Margin="0,0,20,0" VerticalAlignment="Center" />
                            <ComboBox Name="boxSoftwareCost" Width="220" SelectedIndex="1">
                                <ComboBoxItem Content="0-$1,000" />
                                <ComboBoxItem Content="1,000-$10,000" />
                                <ComboBoxItem Content="$10,000+" />
                            </ComboBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Name="panelPONumber" Margin="10,0,0,10">
                            <TextBlock Text="PO Number" Width="180" VerticalAlignment="Center" />
                            <Button Name="btnHelpPONumber" Content="?" Height="20" Margin="0,0,20,0" VerticalAlignment="Center" />
                            <StackPanel Orientation="Horizontal" Margin="2" Name="panelGroupName">
                                <TextBox x:Name="boxPONumber" Text="{Binding GroupName, Mode=TwoWay, ValidatesOnExceptions=True, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" Width="220" HorizontalAlignment="Left" BindingValidationError="boxPONumber_BindingValidationError" />
                                <dataInput:DescriptionViewer Margin="4" Target="{Binding ElementName=boxPONumber}"/>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="10,0,0,10" Height="25">
                            <TextBlock Text="Is this Software Contracted" VerticalAlignment="Center" Width="180" />
                            <Button Name="btnHelpSoftwareContracted" Content="?" Height="20" />
                            <StackPanel Name="panelButtonBar_SoftwareContracted" Orientation="Horizontal" Margin="20,0,0,0">
                                <Border BorderBrush="DarkGray" Name="btnSoftwareContracted_YES" BorderThickness="1.5" MouseLeftButtonDown="btnSoftwareContracted_YES_MouseLeftButtonDown">
                                    <TextBlock Text="Yes" Width="50" TextAlignment="Center" VerticalAlignment="Center" />
                                </Border>
                                <Border BorderBrush="DarkGray" Name="btnSoftwareContracted_NO" BorderThickness="1.5" Background="#FF95BCF2" MouseLeftButtonDown="btnSoftwareContracted_NO_MouseLeftButtonDown">
                                    <TextBlock Text="No"  Width="50" TextAlignment="Center" VerticalAlignment="Center" />
                                </Border>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel Name="panelSoftwareEULA" Orientation="Horizontal" Margin="10,0,10,0">
                            <TextBlock Text="Software EULA" Width="180" VerticalAlignment="Top" />
                            <Button Name="btnHelpSoftwareEULA" Content="?" Height="20" Margin="0,0,20,0" VerticalAlignment="Top" />
                            <RichTextBox Name="boxSoftwareEULA" Height="300" Width="540" />
                        </StackPanel>
                        <StackPanel Name="panelLicenseKey" Orientation="Horizontal" Margin="10">
                            <TextBlock Text="License Key(s)" Width="180" VerticalAlignment="Center" />
                            <Button Name="btnHelpLicenseKeys" Content="?" Height="20" Margin="0,0,20,0" VerticalAlignment="Center" />
                            <ComboBox Name="boxLicenseKeyChoice" SelectedIndex="2" Width="220" SelectionChanged="boxLicenseKeyChoice_SelectionChanged">
                                <ComboBoxItem Content="Group License Key" />
                                <ComboBoxItem Content="Unique Individual License Key(s)" />
                                <ComboBoxItem Content="No License Key" />
                            </ComboBox>
                        </StackPanel>
                        <StackPanel Name="panelLicenseKeyUploader" Orientation="Vertical" Margin="80,10,10,10" Width="400" Visibility="Collapsed">
                            <ListBox Name="listBoxLicenseKeys" Height="200" Width="400" />
                            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
                                <Button Name="btnRemoveLicenseKey" Content="Remove Key" HorizontalAlignment="Right" Margin="5" Click="btnRemoveLicenseKey_Click" />
                                <Button Name="btnAddLicenseKey" Content="Add License Key" HorizontalAlignment="Right" Margin="5" Click="btnAddLicenseKey_Click" />
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>
                    <controlsToolkit:BusyIndicator Name="busyIndicatorSoftwareOwnership">
                        <StackPanel Name="panelSoftwareOwnership"> 
                            <StackPanel Orientation="Horizontal" Name="panelDivisionOfOwnership" Margin="10,0,0,10">
                                <TextBlock Text="Division of Ownership" Width="180" VerticalAlignment="Center" />
                                <Button Name="btnHelpDivisonOfOwnership" Content="?" Height="20" Margin="0,0,20,0" VerticalAlignment="Center" />
                                <ComboBox Name="boxDivisonOfOwnership" Width="220" SelectionChanged="boxDivisonOfOwnership_SelectionChanged">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding Name}" />
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Name="panelDepartmentOfOwnership" Margin="10,0,0,10">
                                <TextBlock Text="Department of Ownership" Width="180" VerticalAlignment="Center" />
                                <Button Name="btnHelpDepartmentOfOwnership" Content="?" Height="20" Margin="0,0,20,0" VerticalAlignment="Center" />
                                <ComboBox Name="boxDepartmentOfOwnership" Width="220" ItemsSource="{Binding SelectedItem.Departments, ElementName=boxDivisonOfOwnership}">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding name}" />
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </StackPanel>
                        </StackPanel>
                    </controlsToolkit:BusyIndicator>
                </StackPanel>
                <Button Name="btnSaveLicensingData" Width="120" Content="Save Licensing Data" HorizontalAlignment="Right" Margin="10" Click="btnSaveLicensingData_Click" />
                <Button Name="btnNext" Width="120" Content="Next" HorizontalAlignment="Right" Margin="10" Click="btnNext_Click" Visibility="Collapsed" />
            </StackPanel>
        </controlsToolkit:BusyIndicator>
        <Border BorderBrush="Silver" BorderThickness="1" Grid.RowSpan="4" Grid.ColumnSpan="3" Name="border1">
        </Border>
    </Grid>
</navigation:Page>
